﻿#pragma once
#include <QObject>
#include "Drillingrig_global.h"
#include "AbstruactEventMediator.h"

class  DrillingrigMediator : public QObject, public AbstruactEventMediator
{
	Q_OBJECT
public:
	DrillingrigMediator(QObject* parent = nullptr);
	~DrillingrigMediator();

	void registerAction(EquipmentAction* action, QStringView const name) override;

	void unRegisterAction(QStringView const name) override;

	void push(QJsonObject const& obj, QStringView const who = QStringView()) override;

	void setCamera(QStringList const& cameras) override;

	void push(QJsonObject const& obj, QStringView const who, QStringView const to) override;

	void reportLog(QStringView log, int level = 0) override;

	void connectStateChanged(int state) override;

	QVariant request(QJsonObject const& obj, QStringView const requester, QStringView const to) override;

private:
	std::map<QString, EquipmentAction*> m_equipmentActions;		//存放事件交互接口对象
};
